<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateShopCarTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    // 购物车表
    public function up()
    {
        Schema::create('shop_car', function (Blueprint $table) {
            // 编号 用户ID 商品ID 商品数量 价格 状态：1-未支付 2-已支付
            $table->increments('id');
            $table->integer('user_id');
            $table->integer('goods_id');
            $table->integer('number');
            $table->integer('money');
            $table->tinyInteger('status')->default(1);
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('shop_car');
    }
}
